<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <style>
    body {
      width: 400px;
      padding: 15px;
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
      color: #333;
    }
    .button {
      padding: 12px 20px;
      background: #4CAF50;
      color: white;
      border: none;
      border-radius: 4px;
      cursor: pointer;
      font-size: 14px;
      font-weight: 500;
      width: 100%;
      transition: background-color 0.3s;
    }
    .button:hover {
      background: #45a049;
    }
    .button:active {
      background: #3d8b40;
    }
    #results {
      margin-top: 15px;
      max-height: 400px;
      overflow-y: auto;
      padding: 10px;
      background-color: #f9f9f9;
      border-radius: 4px;
      border: 1px solid #e0e0e0;
    }
    h3 {
      margin: 0 0 10px 0;
      color: #2c3e50;
    }
    .bookmark-group {
      margin-bottom: 15px;
      padding-bottom: 15px;
      border-bottom: 1px solid #e0e0e0;
    }
    .bookmark-group:last-child {
      border-bottom: none;
    }
    .bookmark-url {
      font-weight: 600;
      color: #3498db;
      word-break: break-all;
      margin-bottom: 8px;
    }
    .bookmark-item {
      margin-left: 15px;
      color: #666;
      font-size: 13px;
      line-height: 1.4;
    }
    .bookmark-item.sub-item {
      padding-left: 15px;
      font-size: 13px;
    }
    .loading {
      display: inline-block;
      width: 20px;
      height: 20px;
      border: 3px solid #f3f3f3;
      border-top: 3px solid #4CAF50;
      border-radius: 50%;
      animation: spin 1s linear infinite;
      vertical-align: middle;
      margin-right: 8px;
    }
    @keyframes spin {
      0% { transform: rotate(0deg); }
      100% { transform: rotate(360deg); }
    }
    .message {
      padding: 10px;
      border-radius: 4px;
      margin-bottom: 10px;
    }
    .message-success {
      background-color: #d4edda;
      color: #155724;
      border: 1px solid #c3e6cb;
    }
    .message-error {
      background-color: #f8d7da;
      color: #721c24;
      border: 1px solid #f5c6cb;
    }
    .message-info {
      background-color: #d1ecf1;
      color: #0c5460;
      border: 1px solid #bee5eb;
    }
    .category-group {
      margin-bottom: 15px;
      padding-bottom: 15px;
      border-bottom: 1px solid #e0e0e0;
    }
    .category-title {
      font-weight: 600;
      color: #2c3e50;
      margin-bottom: 8px;
    }
    .subcategories {
      margin-left: 15px;
    }
    .subcategory-group {
      margin-bottom: 10px;
      padding: 8px;
      background-color: #ffffff;
      border-radius: 4px;
      border: 1px solid #e0e0e0;
    }
    .subcategory-title {
      font-weight: bold;
      color: #555;
      margin-bottom: 5px;
      font-size: 14px;
    }
    .uncategorized {
      margin-top: 10px;
      padding: 8px;
      background-color: #f0f0f0;
      border-radius: 4px;
    }
    .invalid-bookmark {
      padding: 8px;
      background-color: #fff3cd;
      border: 1px solid #ffeaa7;
      border-radius: 4px;
      margin-bottom: 8px;
    }
    .invalid-bookmark .title {
      font-weight: 600;
      color: #856404;
    }
    .invalid-bookmark .url {
      font-size: 12px;
      color: #856404;
      word-break: break-all;
    }
    .button:disabled {
      background-color: #cccccc;
      cursor: not-allowed;
    }
  </style>
</head>
<body>
    <h2 style="text-align: center; margin-bottom: 20px;">书签清理工具</h2>
    <div style="display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 15px;">
      <button class="button" id="scanBtn">扫描重复书签</button>
      <button class="button" id="analyzeBtn">分析和分类书签</button>
      <button class="button" id="validateBtn">校验书签有效性</button>
      <button class="button" id="removeInvalidBtn" disabled>一键清除无效书签</button>
      <button class="button" id="configBtn">配置分类</button>
    </div>
    <div id="results" class="message info">
      点击上方按钮开始扫描或分析书签
    </div>
  <script src="popup.js"></script>
</body>
</html>